package cloudInformation.exception;

import cloudEntity.utils.ResultUtils;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: Smart School
 * @ClassName GlobalExceptionHandler
 * @description: 全局异常 处理类
 * @author: 陈智博
 * @create: 2025-04-16 08:03
 * @Version 1.0
 **/
@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(PermissionException.class)
    @ResponseBody
    public ResultUtils exceptionHandler(PermissionException e) {
        return ResultUtils.failed(e.getMessage());
    }

}
